import { init } from "snabbdom/build/package/init"
import { h } from "snabbdom/build/package/h"

// init([])返回patch函数，patch(oldVnode 或者 真实 DOM , newVnode)对比两个参数的差异,将vnode转换成真实dom渲染到页面上。
let patch = init([])

let app = document.getElementById('container')

// h('选择器或标签', [{}] ,[] or '')，返回vnode
let vnode = h('div.cls','hello world')

let oldVnode = patch(app,vnode)

vnode = h('div.xxx','Hello Snabbdom')
patch(oldVnode,vnode)
